/**世袭图相关变量*/


var nodeLeftHeightAppMax={};
var nodeRightHeightAppMax={};
var nodeLeftAppendWidth={};
var nodeRightAppendWidth={};


//单行提高高度
var geneHeightAdd = {};

//节点添加的高度
var nodeAppendHeight = {};

var nodeAppendWidth = {};
//节点底部
var nodeBottomAppend = {};

var sxSetting={};
var isShiXiTu=0;
/* end 世袭图相关变量 end */

var nodeSmall = 0;//节点采用小字
var renderedNodes = {}, boxList = [];

var jpChars = ['"', ",", ".", "，", "。", ";", "'", "；","，","、","!","?","？","！"];

//新字体替换
var  newDownLoadReplaceChars={"(":"︵",")":"︶","（":"︵","）":"︶"};

//新下载替换内容
var newCharsReplaceForDown=function(text){
    if(text)
    {

        for(var c in newDownLoadReplaceChars){
            while(text.indexOf(c)>=0)
            {
                //var  pattern= "/"+c+"/g";
                text= text.replace(c,newDownLoadReplaceChars[c]);
            }
        }
    }
    return text;
}

var downLoadChars={"—":"－"};
//获得兄弟 姐妹 们的排序
var getNodeSexBrothersort = function ($node) {
    
    $ff = spouseList[$node.father];
    var bsort = $node.brothersort;
    var sex = $node.sex == "1";

    if ($ff) {
        var bss = -3;
        if (sex) {
            bss = $ff.getSonSort($node);
        }
        else {
            bss = $ff.getDautSort($node);
        }
        if (bss >= 0) {
            bsort = bss;
        }
    }
    return bsort;
}
//获得节点 出生Str
var getNodeBirthStr=function($node){
}

//判断是否为公
var nodeIsGong = function (node){
    if (node.honorific.lastIndexOf("公")>0 && node.honorific.trim().lastIndexOf("公") == node.honorific.trim().length - 1) {
        return true;
    }
    return false;
}
//获得嫁入人 来源信息 
var  getFatherDautInfo=function(node){
    if(node.marryfather)
    {
        if(node.marryfather.lastIndexOf("女")== node.marryfather.length-1 &&node.marryfather.lastIndexOf("女")>0){
            return node.marryfather.trim();
        }
        if(node.marryfather.lastIndexOf("之妹")== node.marryfather.length-2  &&node.marryfather.lastIndexOf("之妹")>0){
            return node.marryfather.trim();
        }
        if(node.marryfather.lastIndexOf("之姐")== node.marryfather.length-2 &&node.marryfather.lastIndexOf("之姐")>0){
            return node.marryfather.trim();
        }
        return node.marryfather + "之女";
    }
    return "";
}

//获得列表的名字
var getListName=function(dbNode){
    if($advanced['fmruming']==1)
    {
        if(dbNode.truename){
            if(dbNode.truename.length==0){
                return dbNode.xing+dbNode.truename;
            }
            return dbNode.truename;
        }
    }
    return getJPShowName(dbNode);
}


//获得数字 字符串
var getNumberText = function (text) {
    return text;
    var number = "";
    var n1 = "";
    for (var j = 0; j < text.length; j++) {
        var c = text.substr(j, 1);
        if (!isNaN(parseInt(c))) {
            number += "<div class='year-number'> " + c + "</div>";
            n1 += c;
        }
    }
    if($isDownload==1)
    {
        return text.replace(n1, "<div class='year-number-div'>" + number + "</div>");
    }
    return text;
}

//处理空格
var leaveBlankSpace=function(text){
    if(text)
    {
       if($advanced['userempty']==1)
       {
            return text.replace(/\|/g, "　");
       }
       return text.replace(/\|/g, "");
   }
   return text;
}


//获得父亲显示的名字
var getFatherShowName=function(dbNode){
     var name = "";
    if (dbNode.sex == "1") {
        name = dbNode.honorific ? dbNode.honorific : dbNode.truename;
        if (name.length == 1) {
            name = dbNode.xing + name;
        }
    }
    else {
        if (dbNode.truename) {
            name = dbNode.truename;
            if (name.length == 1) {
                name = dbNode.xing + name;
            }
        }
        else if (dbNode.xing && dbNode.marryinto) {
            return dbNode.xing + "氏";
        }
    }
    if (name.length > 2 ) {
        if (nodeIsGong(dbNode) && name.trim().length>2)
        {
            return name.replace("公","");
        }
        name = name.substr(name.length - 2);
    }
    return name;
}

//需要换宋体样式字符
var setCharForSongTi=function(html){
    var str="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
    html.find('.font27').each(function(){
        var r = $(this);
        if(str.indexOf(r.text())>-1){
            r.addClass("text-songti");
        }
    });
    return html;
}
//转化 字符 特殊字符 古式 需要替换
var changeDownlaodText=function(html){
    html.find('.font27').each(function(){
        var r = $(this).text();

        for(var j in downLoadChars)
        {
            if(r.indexOf(j)>-1){
                $(this).html('<img src="/assets/attch/gu-shu.jpg" />');
            }
        }
        var c =newCharsReplaceForDown($(this).text());
        if(c)
        {
            $(this).text(c);
        }
    });
    return html;
}


//获得显示的名字
var getJPShowName = function (dbNode) {
    var name = "";
    if(sxSetting.nanname==1 && isShiXiTu){
        name = dbNode.honorific ? dbNode.honorific : dbNode.truename;
        if(!name && dbNode.sex==0){
            name ="氏";
        }
        return dbNode.xing+ name;
    }
    if (dbNode.sex == "1") {
        name = dbNode.honorific ? dbNode.honorific : dbNode.truename;
        if(isShiXiTu){
            if(parseInt(sxSetting.ruminshidai)<=parseInt(dbNode.shidai)){
                if(dbNode.truename)
                {
                    name = dbNode.truename;   
                }
            }
            
        }
        if (name.length == 1) {
            name = dbNode.xing + name;
        }        
    }
    else {
        if (dbNode.truename) {
            name = dbNode.truename;
            if (name.length == 1) {
                name = dbNode.xing + name;
            }
        }
        else if (dbNode.xing && dbNode.marryinto) {
            return dbNode.xing + "氏";
        }
    }
    if (name.length > 2) {
        if (nodeIsGong(dbNode))
        {
            return name;
        }
        name = name.substr(name.length - 2);
    }
    return name;
}


//页面信息
var pageInfo=function(){
    this.title="";//标题
    this.summay="";//摘要
    this.pageType="";//页面类型
    this.litpic="";//缩略图
}
var currentPageInfo = new pageInfo();
//纠正时间
var correctingTime=function($node){
    switch (parseInt($node.tformat)) {
        case 1:
            $node.birthstr = $node.cbirthday;
            break;
    }
    switch (parseInt($node.dietformat)) {
        case 1:
            $node.diestr =  $node.cdieday;
            break;
    }
}

var getNodeDiaoTuSortText=function($node, sxSetting){
    if(sxSetting.sorttype==1){
        var sex = $node.sex == "1";
        switch (parseInt($node.relationship)) {
            case 3:
                return "";
                /*
                case 2:
                return "抚出";
                */
        }
        return getNodeSexBrothersort($node);
    }
    return getNodeRelationshipText($node);
}

///获得兄弟节点信息
var getNodeRelationshipText = function ($node) {
    var sex = $node.sex == "1";
    switch (parseInt($node.relationship)) {
        case 3:
            return "嗣" + (sex ? "子" : "女");
            /*
            case 2:
            return "抚出";
            */
    }
    $ff = spouseList[$node.father];
    if ($ff) {
        var qsoncnt = 0;
        var fjcnt = 0;
        var p = sex ? $ff.sons : $ff.daughters;
        for (var j = 0; j < p.length; j++) {
            if ($nodes[p[j]].relationship != "3") {
                qsoncnt++;
            }
            else {
                fjcnt++;
            }
        }
    }
    if (fjcnt > 0 && qsoncnt == 1) {
        return "之" + (sex ? "子" : "女");
    }
    return getBortherSortText(getNodeSexBrothersort($node)) + (sex ? "子" : "女");
}
      //设置上传的图片
    function setUploadBoxImage(url){
        $(".span-avatar-uploading").css({"background-image":"url("+url+")"});
    }


//填充信息
var fillSummay = function ($div, summay) {
    fillContent($div, summay);
    $div.attr('text', summay);
}

//获得兄弟排行的汉字
var getBortherSortText = function (sort) {
    switch (sort.toString()) {
        case "0":
            console.log("数据错误");
            return "长";
        case "1":
            return "长";
        case "2":
            return "次";
        default:
            return chineseNumber[sort];

    }
}
//获得字符串添加Span
var getStringSpans = function (str, cla) {
    $data = [];
    if (str) {
        var datas = str.split("");
        for (var j = 0; j < datas.length; j++) {
            var char = datas[j];
            $data[$data.length] = getSpan(datas[j], cla);
            /*
            if (isSpecialChar(char)) {
                $data[$data.length] = char;
            }
            else {
                $data[$data.length] = getSpan(datas[j], cla);
            }
            */
        }
    }
    return $data;
}
//获得字符串添加Span
var fillContent = function ($div, str) {
    $div.html("");
    divAppend($div, str);
}
//添加DIV Span
var divAppend = function ($div, str, cla) {
    $datas = getStringSpans(str, cla);

    for (var j = 0; j < $datas.length; j++) {
        $div.append($datas[j]);
    }
}

//字符串转Span
var getSpan = function (char, cla) {
   
    $span = $('<span>' + char + '</span>');
    $span.addClass('font27');
    if (cla) {
        $span.addClass(cla);
    }
    return $span;

}

//判断是否特殊关键字
var isSpecialChar = function (char) {
    for (var j = 0; j < jpChars.length; j++) {
        if (char == jpChars[j]) {
            return true;
        }
    }
    return false;
}


//获得兄弟 姐妹 们的排序
var getNodeSexBrothersort = function ($node) {
    $ff = spouseList[$node.father];
    var bsort = $node.brothersort;
    var sex = $node.sex == "1";
 
    if ($ff) {
        var bss = -3;
        if (sex) {
            
            bss = $ff.getSonSort($node);
        }
        else {
            bss = $ff.getDautSort($node);
        }
        if (bss >= 0) {
            bsort = bss;
        }
        //处理数据
    }
    return bsort;
}

var getNodeRelationshipText = function ($node) {

    var sex = $node.sex == "1";
    switch (parseInt($node.relationship)) {
        case 3:
            return "嗣" + (sex ? "子" : "女");
            /*
            case 2:
            return "抚出";
            */
    }
    $ff = spouseList[$node.father];
    if ($ff) {
        var qsoncnt = 0;
        var fjcnt = 0;
        var p = sex ? $ff.sons : $ff.daughters;
        for (var j = 0; j < p.length; j++) {
            if ($nodes[p[j]].relationship != "3") {
                qsoncnt++;
            }
            else {
                fjcnt++;
            }
        }
    }
    if (fjcnt > 0 && qsoncnt == 1) {
        return "之" + (sex ? "子" : "女");
    }
    return getBortherSortText(getNodeSexBrothersort($node)) + (sex ? "子" : "女");
}

 
//获得字辈值
function getZiBeiText(gene) {
    if ($zibeiList && $zibeiList[gene]) {
        return $zibeiList[gene];
    }
    return "";
} 

/*****************夫妻列表信息 ******************************/

    function joinNodes() {
     
        spouseList={};
        /*
        for(var j in $nodes)
        {
            addSpouseInfo($nodes[j]);
        }
        */
     
        if(!$nodeIds){
            $nodeIds= $nodeIds;
        }
        for(var j=0;j<$nodeIds.length;j++)
        {
            var n =$nodes[$nodeIds[j]];
            addSpouseInfo(n);
        }
        for(var j=0;j<$nodeIds.length;j++)
        {
            var $n = $nodes[$nodeIds[j]];
            if ($n.father > 0 && spouseList[$n.father]) {
                addChildren(spouseList[$n.father], $n);
            }
            if ($n.mother > 0 && spouseList[$n.mother]) {
                addChildren(spouseList[$n.mother], $n);
            }
            if ($n.sex == "0") {
                var spouse = $n.spouse;
                if (spouseList[spouse] && spouseList[spouse].wife == 0) {
                    spouseList[spouse].wife = $n.id;
                }
            }
        }
    }

    function addChildren(spouseInfo, ch) {
        //this.sonsSorts = {};
        //this.daugSorts = {};
        var sort = parseInt(ch.brothersort);
        if (ch.sex == "1") {
            spouseInfo.sons[spouseInfo.sons.length] = ch.id;
            while (spouseInfo.sonsSorts[sort]) {
                sort++;
            }
            spouseInfo.sonsSorts[sort]=ch.id;
        } else {
            spouseInfo.daughters[spouseInfo.daughters.length] = ch.id;
            while (spouseInfo.daugSorts[sort]) {
                sort++;
            }
            spouseInfo.daugSorts[sort] = ch.id;
        }
    }

    //生养信息 
    function addSpouseInfo($node) {
        var id = $node.id;
        var m = spouseList[id];
        if (m == null) {
            var si = new spouseInfo();
            si.mainid = id;
            if ($node.sex == "1") {
                si.husband = id;
                if ($node.spouse == 0) {
                    si.windex = 0;
                    si.wife = 0;
                    spouseList[id] = si;
                }
                else {
                    si.addWife($node.spouse);
                    si.wife = $node.spouse;
                    spouseList[id] = si;
                }
            }
            else {
                if ($node.spouse> 0) {
                    si.husband = $node.spouse;
                    var b1 =spouseList[si.husband];
                    if(b1){
                        b1.addWife(id);
                    }
                }
                spouseList[id] = si;
            }
        }
    }

    //家庭信息 夫妻信息
    var spouseInfo = function () {
        this.mainid = 0;
        this.husband = 0;
        this.wife = 0;
        this.sons = [];
        this.wifes = [];
        this.windex = 1; //妻子排序
        this.daughters = [];
        this.sphoto = []; //夫妻合照
        this.fphoto = []; //家庭合照
        this.sonsSorts = {};
        this.daugSorts = {};
        this.getMainId=function(){
            if(this.husband){
                return this.husband.id;
            }
            return this.wifes[0].id;
        }

        this.childrensCount=function(){
            return  this.sons.length+this.daughters.length;
        }
        //添加妻子
        this.addWife=function(wife){
            if(this.mainid== this.husband){
                if(this.wife==0) this.wife=wife;
                for(var j=0;j<this.wifes.length;j++)
                {
                    if(this.wifes[j] == wife){
                        return;
                    }
                }
                this.wifes[this.wifes.length]= wife;
            }
        }

        //无后的标准
        this.unOffSetting=function(offType){
            switch(parseInt(offType)){
                case 0:
                    return false;
                case 1:
                    return this.sons.length==0;
                case 2:
                    return this.sons.length== 0 && this.daughters.length==0;
                case 3:
                    var n =$nodes[this.mainid];
                    return  n.nochildren ==1;
                    //if(n.
                    break;
                default:
                    console.log("无法识别的无后判断标准"+offType);
                    break;
            }
            return false;
        }

        //获得儿子的排行
        this.getSonSort = function ($sonNode) {
            var i = 0;
            for (var j in this.sonsSorts) {
                if (this.sonsSorts[j] == $sonNode.id) {
                    return i + 1;
                }
                if ($nodes[this.sonsSorts[j]].relationship != 3) {
                    i++;
                }
            }
            return -1;
        }
        //获得女儿的排行
        this.getDautSort = function ($dutNode) {
            var i = 0;
            for (var j in this.daugSorts) {
                if (this.daugSorts[j] == $dutNode.id) {
                    return i + 1;
                }
                if ($nodes[this.daugSorts[j]].relationship != 3) {
                    i++;
                }
            }
            return -1;
        }
    }

    //夫妻列表
    var spouseList = {};
    
    /** 获得 关系文字 **/
    var getShipText=function(parent, children)
    {
        var spouseInfo= spouseList[parent.id];
        var zinv=children.sex=="1" ?"子":"女";
        if(children.relationship=="3"){
            return "嗣"+zinv;
        } 
        if(children.sex==1){
            for (var j = 0; j < spouseInfo.sons.length; j++) {
                if(spouseInfo.sons[j] == children.id){
                    return getBortherSortText((j + 1)) + "子";
                }
            }
        }
        else{
            for (var j = 0; j < spouseInfo.daughters.length; j++) {
                if(spouseInfo.daughters[j] == children.id){
                    return getBortherSortText((j + 1)) + "女";
                }
            }
        }
        console.log("无法识别子女信息  parent:{"+parent.id+ "--"+ parent.truename+"}, children:{"+children.id+"--"+children.truename+"}");
        return "";
    };

    
    //获得节点的 关系 文字
    var getNodeIndexShipText=function(n){
        var m = n.mother;
        var t="";
        if( spouseList[n.mother]){
            
            t = getShipText($nodes[n.mother],n);
        }
        if(!t){
            if(spouseList[n.father]){
                t = getShipText($nodes[n.father],n);
            }
        }
        if(!t){
            t=getNodeRelationshipText(n);
        }
        return t;
    };
var addNodeData2List=function(node){
    $nodes[node.id]= node;
    $nodeIds[$nodeIds.length]= node.id;
    joinNodes();
}

//////////////处理时间格式化//////////////////////////////
var timeGeShi=function(val,jiapu,control,oldControl){
        if (jiapu.origtime == "1") {
            return;
        }
        if (val.indexOf("生于") === 0 || val.indexOf("卒于") === 0 || val.indexOf("殁于") === 0) {
            val = val.substr(2);
        }
        if (val.indexOf("生") === 0 || val.indexOf("卒") === 0 || val.indexOf("殁") === 0) {
            val = val.substr(1);
        }
        if(oldControl)
        {
            oldControl.val(val);
        }
        else
        {
            control.val(val);
        }
        $rootUrl = "http://42.120.18.53:8081/api/q.ashx?r=?";
        var dateMark=["阴历","阳历","农历","公元","公历"];
        
        var pMark="";
        for(var j=0;j<dateMark.length;j++){
             if(val.indexOf(dateMark[j])==0){
                pMark=dateMark[j];
                break;
             }
        }
        var chars = ["享", "寿"];
        
        var notTime = "";
        var notTimeChar = "";
        for (var j = 0; j < chars.length; j++) {
            notTimeChar = chars[j];
            if (val.indexOf(notTimeChar) > 0) {
                //notTime
                var d = val.split(notTimeChar);
                val = d[0];
                notTime = d[1];
                break;
            }
        }
        $.getJSON($rootUrl, { a: 'year', yearishanzi: jiapu.yearishanzi, 'shichen': jiapu.shichen, 'jzsui': jiapu.jiazi, 'val': val }, function (r) {
            if (r) {
                if(notTime!="")
                {
                    r = r+notTimeChar+notTime;
                }                  
                if(pMark!="" && r.indexOf(pMark)<0){
                    r =pMark+r;
                }
                control.val(r);
            }
        });
}


    
//数字转汉字 
var chineseNumber = {
         0:"零",1:"一",2:"二",3:"三",4:"四",5:"五",6:"六",7:"七",8:"八",9:"九",10:"十",11:"十一",12:"十二",13:"十三",14:"十四",15:"十五",16:"十六",17:"十七",18:"十八",19:"十九",20:"二十",21:"二十一",22:"二十二",23:"二十三",24:"二十四",25:"二十五",26:"二十六",27:"二十七",28:"二十八",29:"二十九",30:"三十",31:"三十一",32:"三十二",33:"三十三",34:"三十四",35:"三十五",36:"三十六",37:"三十七",38:"三十八",39:"三十九",40:"四十",41:"四十一",42:"四十二",43:"四十三",44:"四十四",45:"四十五",46:"四十六",47:"四十七",48:"四十八",49:"四十九",50:"五十",51:"五十一",52:"五十二",53:"五十三",54:"五十四",55:"五十五",56:"五十六",57:"五十七",58:"五十八",59:"五十九",60:"六十",61:"六十一",62:"六十二",63:"六十三",64:"六十四",65:"六十五",66:"六十六",67:"六十七",68:"六十八",69:"六十九",70:"七十",71:"七十一",72:"七十二",73:"七十三",74:"七十四",75:"七十五",76:"七十六",77:"七十七",78:"七十八",79:"七十九",80:"八十",81:"八十一",82:"八十二",83:"八十三",84:"八十四",85:"八十五",86:"八十六",87:"八十七",88:"八十八",89:"八十九",90:"九十",91:"九十一",92:"九十二",93:"九十三",94:"九十四",95:"九十五",96:"九十六",97:"九十七",98:"九十八",99:"九十九",100:"一百",101:"一百零一",102:"一百零二",103:"一百零三",104:"一百零四",105:"一百零五",106:"一百零六",107:"一百零七",108:"一百零八",109:"一百零九",110:"一百一十",111:"一百一十一",112:"一百一十二",113:"一百一十三",114:"一百一十四",115:"一百一十五",116:"一百一十六",117:"一百一十七",118:"一百一十八",119:"一百一十九",120:"一百二十",121:"一百二十一",122:"一百二十二",123:"一百二十三",124:"一百二十四",125:"一百二十五",126:"一百二十六",127:"一百二十七",128:"一百二十八",129:"一百二十九",130:"一百三十",131:"一百三十一",132:"一百三十二",133:"一百三十三",134:"一百三十四",135:"一百三十五",136:"一百三十六",137:"一百三十七",138:"一百三十八",139:"一百三十九",140:"一百四十",141:"一百四十一",142:"一百四十二",143:"一百四十三",144:"一百四十四",145:"一百四十五",146:"一百四十六",147:"一百四十七",148:"一百四十八",149:"一百四十九",150:"一百五十",151:"一百五十一",152:"一百五十二",153:"一百五十三",154:"一百五十四",155:"一百五十五",156:"一百五十六",157:"一百五十七",158:"一百五十八",159:"一百五十九",160:"一百六十",161:"一百六十一",162:"一百六十二",163:"一百六十三",164:"一百六十四",165:"一百六十五",166:"一百六十六",167:"一百六十七",168:"一百六十八",169:"一百六十九",170:"一百七十",171:"一百七十一",172:"一百七十二",173:"一百七十三",174:"一百七十四",175:"一百七十五",176:"一百七十六",177:"一百七十七",178:"一百七十八",179:"一百七十九",180:"一百八十",181:"一百八十一",182:"一百八十二",183:"一百八十三",184:"一百八十四",185:"一百八十五",186:"一百八十六",187:"一百八十七",188:"一百八十八",189:"一百八十九",190:"一百九十",191:"一百九十一",192:"一百九十二",193:"一百九十三",194:"一百九十四",195:"一百九十五",196:"一百九十六",197:"一百九十七",198:"一百九十八",199:"一百九十九",200:"二百",201:"二百零一",202:"二百零二",203:"二百零三",204:"二百零四",205:"二百零五",206:"二百零六",207:"二百零七",208:"二百零八",209:"二百零九",210:"二百一十",211:"二百一十一",212:"二百一十二",213:"二百一十三",214:"二百一十四",215:"二百一十五",216:"二百一十六",217:"二百一十七",218:"二百一十八",219:"二百一十九",220:"二百二十",221:"二百二十一",222:"二百二十二",223:"二百二十三",224:"二百二十四",225:"二百二十五",226:"二百二十六",227:"二百二十七",228:"二百二十八",229:"二百二十九",230:"二百三十",231:"二百三十一",232:"二百三十二",233:"二百三十三",234:"二百三十四",235:"二百三十五",236:"二百三十六",237:"二百三十七",238:"二百三十八",239:"二百三十九",240:"二百四十",241:"二百四十一",242:"二百四十二",243:"二百四十三",244:"二百四十四",245:"二百四十五",246:"二百四十六",247:"二百四十七",248:"二百四十八",249:"二百四十九",250:"二百五十",251:"二百五十一",252:"二百五十二",253:"二百五十三",254:"二百五十四",255:"二百五十五",256:"二百五十六",257:"二百五十七",258:"二百五十八",259:"二百五十九",260:"二百六十",261:"二百六十一",262:"二百六十二",263:"二百六十三",264:"二百六十四",265:"二百六十五",266:"二百六十六",267:"二百六十七",268:"二百六十八",269:"二百六十九",270:"二百七十",271:"二百七十一",272:"二百七十二",273:"二百七十三",274:"二百七十四",275:"二百七十五",276:"二百七十六",277:"二百七十七",278:"二百七十八",279:"二百七十九",280:"二百八十",281:"二百八十一",282:"二百八十二",283:"二百八十三",284:"二百八十四",285:"二百八十五",286:"二百八十六",287:"二百八十七",288:"二百八十八",289:"二百八十九",290:"二百九十",291:"二百九十一",292:"二百九十二",293:"二百九十三",294:"二百九十四",295:"二百九十五",296:"二百九十六",297:"二百九十七",298:"二百九十八",299:"二百九十九",300:"三百",301:"三百零一",302:"三百零二",303:"三百零三",304:"三百零四",305:"三百零五",306:"三百零六",307:"三百零七",308:"三百零八",309:"三百零九",310:"三百一十",311:"三百一十一",312:"三百一十二",313:"三百一十三",314:"三百一十四",315:"三百一十五",316:"三百一十六",317:"三百一十七",318:"三百一十八",319:"三百一十九",320:"三百二十",321:"三百二十一",322:"三百二十二",323:"三百二十三",324:"三百二十四",325:"三百二十五",326:"三百二十六",327:"三百二十七",328:"三百二十八",329:"三百二十九",330:"三百三十",331:"三百三十一",332:"三百三十二",333:"三百三十三",334:"三百三十四",335:"三百三十五",336:"三百三十六",337:"三百三十七",338:"三百三十八",339:"三百三十九",340:"三百四十",341:"三百四十一",342:"三百四十二",343:"三百四十三",344:"三百四十四",345:"三百四十五",346:"三百四十六",347:"三百四十七",348:"三百四十八",349:"三百四十九",350:"三百五十",351:"三百五十一",352:"三百五十二",353:"三百五十三",354:"三百五十四",355:"三百五十五",356:"三百五十六",357:"三百五十七",358:"三百五十八",359:"三百五十九",360:"三百六十",361:"三百六十一",362:"三百六十二",363:"三百六十三",364:"三百六十四",365:"三百六十五",366:"三百六十六",367:"三百六十七",368:"三百六十八",369:"三百六十九",370:"三百七十",371:"三百七十一",372:"三百七十二",373:"三百七十三",374:"三百七十四",375:"三百七十五",376:"三百七十六",377:"三百七十七",378:"三百七十八",379:"三百七十九",380:"三百八十",381:"三百八十一",382:"三百八十二",383:"三百八十三",384:"三百八十四",385:"三百八十五",386:"三百八十六",387:"三百八十七",388:"三百八十八",389:"三百八十九",390:"三百九十",391:"三百九十一",392:"三百九十二",393:"三百九十三",394:"三百九十四",395:"三百九十五",396:"三百九十六",397:"三百九十七",398:"三百九十八",399:"三百九十九",400:"四百",401:"四百零一",402:"四百零二",403:"四百零三",404:"四百零四",405:"四百零五",406:"四百零六",407:"四百零七",408:"四百零八",409:"四百零九",410:"四百一十",411:"四百一十一",412:"四百一十二",413:"四百一十三",414:"四百一十四",415:"四百一十五",416:"四百一十六",417:"四百一十七",418:"四百一十八",419:"四百一十九",420:"四百二十",421:"四百二十一",422:"四百二十二",423:"四百二十三",424:"四百二十四",425:"四百二十五",426:"四百二十六",427:"四百二十七",428:"四百二十八",429:"四百二十九",430:"四百三十",431:"四百三十一",432:"四百三十二",433:"四百三十三",434:"四百三十四",435:"四百三十五",436:"四百三十六",437:"四百三十七",438:"四百三十八",439:"四百三十九",440:"四百四十",441:"四百四十一",442:"四百四十二",443:"四百四十三",444:"四百四十四",445:"四百四十五",446:"四百四十六",447:"四百四十七",448:"四百四十八",449:"四百四十九",450:"四百五十",451:"四百五十一",452:"四百五十二",453:"四百五十三",454:"四百五十四",455:"四百五十五",456:"四百五十六",457:"四百五十七",458:"四百五十八",459:"四百五十九",460:"四百六十",461:"四百六十一",462:"四百六十二",463:"四百六十三",464:"四百六十四",465:"四百六十五",466:"四百六十六",467:"四百六十七",468:"四百六十八",469:"四百六十九",470:"四百七十",471:"四百七十一",472:"四百七十二",473:"四百七十三",474:"四百七十四",475:"四百七十五",476:"四百七十六",477:"四百七十七",478:"四百七十八",479:"四百七十九",480:"四百八十",481:"四百八十一",482:"四百八十二",483:"四百八十三",484:"四百八十四",485:"四百八十五",486:"四百八十六",487:"四百八十七",488:"四百八十八",489:"四百八十九",490:"四百九十",491:"四百九十一",492:"四百九十二",493:"四百九十三",494:"四百九十四",495:"四百九十五",496:"四百九十六",497:"四百九十七",498:"四百九十八",499:"四百九十九",500:"五百",501:"五百零一",502:"五百零二",503:"五百零三",504:"五百零四",505:"五百零五",506:"五百零六",507:"五百零七",508:"五百零八",509:"五百零九",510:"五百一十",511:"五百一十一",512:"五百一十二",513:"五百一十三",514:"五百一十四",515:"五百一十五",516:"五百一十六",517:"五百一十七",518:"五百一十八",519:"五百一十九",520:"五百二十",521:"五百二十一",522:"五百二十二",523:"五百二十三",524:"五百二十四",525:"五百二十五",526:"五百二十六",527:"五百二十七",528:"五百二十八",529:"五百二十九",530:"五百三十",531:"五百三十一",532:"五百三十二",533:"五百三十三",534:"五百三十四",535:"五百三十五",536:"五百三十六",537:"五百三十七",538:"五百三十八",539:"五百三十九",540:"五百四十",541:"五百四十一",542:"五百四十二",543:"五百四十三",544:"五百四十四",545:"五百四十五",546:"五百四十六",547:"五百四十七",548:"五百四十八",549:"五百四十九",550:"五百五十",551:"五百五十一",552:"五百五十二",553:"五百五十三",554:"五百五十四",555:"五百五十五",556:"五百五十六",557:"五百五十七",558:"五百五十八",559:"五百五十九",560:"五百六十",561:"五百六十一",562:"五百六十二",563:"五百六十三",564:"五百六十四",565:"五百六十五",566:"五百六十六",567:"五百六十七",568:"五百六十八",569:"五百六十九",570:"五百七十",571:"五百七十一",572:"五百七十二",573:"五百七十三",574:"五百七十四",575:"五百七十五",576:"五百七十六",577:"五百七十七",578:"五百七十八",579:"五百七十九",580:"五百八十",581:"五百八十一",582:"五百八十二",583:"五百八十三",584:"五百八十四",585:"五百八十五",586:"五百八十六",587:"五百八十七",588:"五百八十八",589:"五百八十九",590:"五百九十",591:"五百九十一",592:"五百九十二",593:"五百九十三",594:"五百九十四",595:"五百九十五",596:"五百九十六",597:"五百九十七",598:"五百九十八",599:"五百九十九",600:"六百",601:"六百零一",602:"六百零二",603:"六百零三",604:"六百零四",605:"六百零五",606:"六百零六",607:"六百零七",608:"六百零八",609:"六百零九",610:"六百一十",611:"六百一十一",612:"六百一十二",613:"六百一十三",614:"六百一十四",615:"六百一十五",616:"六百一十六",617:"六百一十七",618:"六百一十八",619:"六百一十九",620:"六百二十",621:"六百二十一",622:"六百二十二",623:"六百二十三",624:"六百二十四",625:"六百二十五",626:"六百二十六",627:"六百二十七",628:"六百二十八",629:"六百二十九",630:"六百三十",631:"六百三十一",632:"六百三十二",633:"六百三十三",634:"六百三十四",635:"六百三十五",636:"六百三十六",637:"六百三十七",638:"六百三十八",639:"六百三十九",640:"六百四十",641:"六百四十一",642:"六百四十二",643:"六百四十三",644:"六百四十四",645:"六百四十五",646:"六百四十六",647:"六百四十七",648:"六百四十八",649:"六百四十九",650:"六百五十",651:"六百五十一",652:"六百五十二",653:"六百五十三",654:"六百五十四",655:"六百五十五",656:"六百五十六",657:"六百五十七",658:"六百五十八",659:"六百五十九",660:"六百六十",661:"六百六十一",662:"六百六十二",663:"六百六十三",664:"六百六十四",665:"六百六十五",666:"六百六十六",667:"六百六十七",668:"六百六十八",669:"六百六十九",670:"六百七十",671:"六百七十一",672:"六百七十二",673:"六百七十三",674:"六百七十四",675:"六百七十五",676:"六百七十六",677:"六百七十七",678:"六百七十八",679:"六百七十九",680:"六百八十",681:"六百八十一",682:"六百八十二",683:"六百八十三",684:"六百八十四",685:"六百八十五",686:"六百八十六",687:"六百八十七",688:"六百八十八",689:"六百八十九",690:"六百九十",691:"六百九十一",692:"六百九十二",693:"六百九十三",694:"六百九十四",695:"六百九十五",696:"六百九十六",697:"六百九十七",698:"六百九十八",699:"六百九十九",700:"七百",701:"七百零一",702:"七百零二",703:"七百零三",704:"七百零四",705:"七百零五",706:"七百零六",707:"七百零七",708:"七百零八",709:"七百零九",710:"七百一十",711:"七百一十一",712:"七百一十二",713:"七百一十三",714:"七百一十四",715:"七百一十五",716:"七百一十六",717:"七百一十七",718:"七百一十八",719:"七百一十九",720:"七百二十",721:"七百二十一",722:"七百二十二",723:"七百二十三",724:"七百二十四",725:"七百二十五",726:"七百二十六",727:"七百二十七",728:"七百二十八",729:"七百二十九",730:"七百三十",731:"七百三十一",732:"七百三十二",733:"七百三十三",734:"七百三十四",735:"七百三十五",736:"七百三十六",737:"七百三十七",738:"七百三十八",739:"七百三十九",740:"七百四十",741:"七百四十一",742:"七百四十二",743:"七百四十三",744:"七百四十四",745:"七百四十五",746:"七百四十六",747:"七百四十七",748:"七百四十八",749:"七百四十九",750:"七百五十",751:"七百五十一",752:"七百五十二",753:"七百五十三",754:"七百五十四",755:"七百五十五",756:"七百五十六",757:"七百五十七",758:"七百五十八",759:"七百五十九",760:"七百六十",761:"七百六十一",762:"七百六十二",763:"七百六十三",764:"七百六十四",765:"七百六十五",766:"七百六十六",767:"七百六十七",768:"七百六十八",769:"七百六十九",770:"七百七十",771:"七百七十一",772:"七百七十二",773:"七百七十三",774:"七百七十四",775:"七百七十五",776:"七百七十六",777:"七百七十七",778:"七百七十八",779:"七百七十九",780:"七百八十",781:"七百八十一",782:"七百八十二",783:"七百八十三",784:"七百八十四",785:"七百八十五",786:"七百八十六",787:"七百八十七",788:"七百八十八",789:"七百八十九",790:"七百九十",791:"七百九十一",792:"七百九十二",793:"七百九十三",794:"七百九十四",795:"七百九十五",796:"七百九十六",797:"七百九十七",798:"七百九十八",799:"七百九十九",800:"八百",801:"八百零一",802:"八百零二",803:"八百零三",804:"八百零四",805:"八百零五",806:"八百零六",807:"八百零七",808:"八百零八",809:"八百零九",810:"八百一十",811:"八百一十一",812:"八百一十二",813:"八百一十三",814:"八百一十四",815:"八百一十五",816:"八百一十六",817:"八百一十七",818:"八百一十八",819:"八百一十九",820:"八百二十",821:"八百二十一",822:"八百二十二",823:"八百二十三",824:"八百二十四",825:"八百二十五",826:"八百二十六",827:"八百二十七",828:"八百二十八",829:"八百二十九",830:"八百三十",831:"八百三十一",832:"八百三十二",833:"八百三十三",834:"八百三十四",835:"八百三十五",836:"八百三十六",837:"八百三十七",838:"八百三十八",839:"八百三十九",840:"八百四十",841:"八百四十一",842:"八百四十二",843:"八百四十三",844:"八百四十四",845:"八百四十五",846:"八百四十六",847:"八百四十七",848:"八百四十八",849:"八百四十九",850:"八百五十",851:"八百五十一",852:"八百五十二",853:"八百五十三",854:"八百五十四",855:"八百五十五",856:"八百五十六",857:"八百五十七",858:"八百五十八",859:"八百五十九",860:"八百六十",861:"八百六十一",862:"八百六十二",863:"八百六十三",864:"八百六十四",865:"八百六十五",866:"八百六十六",867:"八百六十七",868:"八百六十八",869:"八百六十九",870:"八百七十",871:"八百七十一",872:"八百七十二",873:"八百七十三",874:"八百七十四",875:"八百七十五",876:"八百七十六",877:"八百七十七",878:"八百七十八",879:"八百七十九",880:"八百八十",881:"八百八十一",882:"八百八十二",883:"八百八十三",884:"八百八十四",885:"八百八十五",886:"八百八十六",887:"八百八十七",888:"八百八十八",889:"八百八十九",890:"八百九十",891:"八百九十一",892:"八百九十二",893:"八百九十三",894:"八百九十四",895:"八百九十五",896:"八百九十六",897:"八百九十七",898:"八百九十八",899:"八百九十九",900:"九百",901:"九百零一",902:"九百零二",903:"九百零三",904:"九百零四",905:"九百零五",906:"九百零六",907:"九百零七",908:"九百零八",909:"九百零九",910:"九百一十",911:"九百一十一",912:"九百一十二",913:"九百一十三",914:"九百一十四",915:"九百一十五",916:"九百一十六",917:"九百一十七",918:"九百一十八",919:"九百一十九",920:"九百二十",921:"九百二十一",922:"九百二十二",923:"九百二十三",924:"九百二十四",925:"九百二十五",926:"九百二十六",927:"九百二十七",928:"九百二十八",929:"九百二十九",930:"九百三十",931:"九百三十一",932:"九百三十二",933:"九百三十三",934:"九百三十四",935:"九百三十五",936:"九百三十六",937:"九百三十七",938:"九百三十八",939:"九百三十九",940:"九百四十",941:"九百四十一",942:"九百四十二",943:"九百四十三",944:"九百四十四",945:"九百四十五",946:"九百四十六",947:"九百四十七",948:"九百四十八",949:"九百四十九",950:"九百五十",951:"九百五十一",952:"九百五十二",953:"九百五十三",954:"九百五十四",955:"九百五十五",956:"九百五十六",957:"九百五十七",958:"九百五十八",959:"九百五十九",960:"九百六十",961:"九百六十一",962:"九百六十二",963:"九百六十三",964:"九百六十四",965:"九百六十五",966:"九百六十六",967:"九百六十七",968:"九百六十八",969:"九百六十九",970:"九百七十",971:"九百七十一",972:"九百七十二",973:"九百七十三",974:"九百七十四",975:"九百七十五",976:"九百七十六",977:"九百七十七",978:"九百七十八",979:"九百七十九",980:"九百八十",981:"九百八十一",982:"九百八十二",983:"九百八十三",984:"九百八十四",985:"九百八十五",986:"九百八十六",987:"九百八十七",988:"九百八十八",989:"九百八十九",990:"九百九十",991:"九百九十一",992:"九百九十二",993:"九百九十三",994:"九百九十四",995:"九百九十五",996:"九百九十六",997:"九百九十七",998:"九百九十八",999:"九百九十九",};
var educationlevel = { 0: "未知", 1: "小学", 2: "初中", 3: "高中", 4: "中专", 5: "大专", 6: "本科", 7: "硕士", 8: "博士", 9: "博士后" };